/*#include<stdio.h>

int shu(int x, int y, int z)
{
	int temp = 0;
	while (temp = x % y)
	{
		x = y;
		y = temp;
	}
	while (temp = y % z)
	{
		y = z;
		z = temp;
	}
	return z;
}
int main()
{
	int n=0,i,a=0,b=0,c=0,x=0;
	scanf("%d", &n);
	for (i = 1; i <= n; i++)
	{
		scanf("%d%d%d", &a, &b, &c);
		x = shu(a, b, c);
		printf("%d\n", x);
	}
	return 0;
}*/